/**
 * 
 */

/**
 * @author osamie
 *
 */
public class Not extends Operator {
	
	//private Data s;
	/**
     * Return the number of arguments this operator takes
     */
    public int nArguments() {
	return 1;
    }

   
    
    /**
     * Evaluate this operator on the given expression
     */
    public Data evaluate(Data args[]) throws TypeException {
    	
    	if ((args[0] instanceof BooleanData)) {
    		
    		
    		
			BooleanData b = (BooleanData)args[0];
			
			
			return new BooleanData(!(b.value));
			
			
    	}   		

	throw new TypeException(getClass().getName()
			+ ": Argument is not boolean");
		
	
    }

    /**
     * Return a string representation of this operator
     */
    public String toString() {
	return "~";
    }

}